<template>
  <el-card>
    <!-- 放置行内form -->
    <el-form inline>
      <el-form-item label="一级分类" style="width: 200px">
        <el-select v-model="categoraryStore.c1Id" @change="categoraryStore.getC2" :disabled="scene">
          <el-option v-for="item in categoraryStore.c1Arr" :key="item.id" :value="item.id" :label="item.name"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="二级分类" style="width: 200px">
        <el-select v-model="categoraryStore.c2Id" @change="categoraryStore.getC3" :disabled="scene">
          <el-option v-for="item in categoraryStore.c2Arr" :value="item.id" :label="item.name" :key="item.id"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="三级分类" style="width: 200px">
        <el-select v-model="categoraryStore.c3Id" :disabled="scene">
          <el-option v-for="item in categoraryStore.c3Arr" :label="item.name" :key="item.id" :value="item.id"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import useCategoraryStore from '../../store/modules/category'
const categoraryStore = useCategoraryStore()
defineProps(["scene"])
onMounted(async () => {
  categoraryStore.getC1()
})

</script>

<style lang="scss" scoped></style>
